package com.AJava1710D.xianchengchi.anli;

import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * 作者: LCG
 * 日期: 2020/6/23 10:50
 * 描述:
 */
public class LianJieStar implements Runnable {

    public static int times=1;

    private ScheduledExecutorService scheduledExecutorService;

    public LianJieStar(ScheduledExecutorService scheduledExecutorService) {
        this.scheduledExecutorService = scheduledExecutorService;
    }

    @Override
    public void run() {

        if(times>3){
            //关闭线程池
            scheduledExecutorService.shutdown();
        }else{
            System.out.println("======发送请求=链接卫星=="+times);
            times++;
        }

    }
}
